package com.itheima.health.controller;

import com.itheima.health.entity.Result;
import com.itheima.health.pojo.Menu;
import com.itheima.health.service.UserService;
import io.swagger.annotations.Api;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = "用户菜单")
public class UserMenuController {

    @Reference
    private UserService userService;
    @GetMapping("menu/queryMenubyUserName/{username}")
    public Result queryMenubyUserName(@PathVariable("username")String username){
        List<Menu> menuList = userService.queryMenubyUserName(username);
        return new Result(menuList);
    }
}
